/**
 * 关爱对象查询
 *
 * @Author: 殷世杰
 * @Date: 2019/09/19
 */
import axios from '@/api/fetch';
import axios2 from 'axios';
import SERVER from '@/api/server';
import { getToken, getAppId } from '@/assets/js/auth';

// 查询关爱任务列表
export const getCareTaskList = params => axios.get(`${SERVER.CYXDMS_CUSTOMERCARE}/careTask/careTasks/listCareTasks`, { params });
// 查询关爱对象明细
export const getCareTaskListById = params => axios.get(`${SERVER.CYXDMS_CUSTOMERCARE}/careTask/careTasks/listCareTarget`, {params});
// 关闭关爱任务
export const modifyCareTaskStatus = id => axios2({
  method: "PUT",
  url: `${SERVER.CYXDMS_CUSTOMERCARE}/careTask/careTasks/modifyCareTaskStatus`,
  data: id,
  headers: {
      "Content-Type": "application/json",
      jwt: getToken(),
      appId: getAppId(),
      userAgent: 'pc'
  }
});
// 再分配关爱任务
export const modifyCareTaskEmp = params => axios.put(`${SERVER.CYXDMS_CUSTOMERCARE}/careTask/careTasks/modifyCareTaskEmp`, params);
// 获取DCRC列表
export const getUserInfoByRole = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/roles/getUserInfoByRolePosition`, {params});
// 获取用户信息
export const getUserInfo = () => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/commonDatas`);

//
export const getCareTaskDetailList = params => axios.get(`${SERVER.CYXDMS_CUSTOMERCARE}/careTask/careTasks/listCareTasks`, { params });
